-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strongly typed wrapper for Negative UNL Ledger Object #25
base: wrapper
Are you sure you want to change the base?
Conversation
src/ripple/app/ledger/Ledger.cpp
Outdated
@@ -737,10 +737,10 @@ Ledger::negativeUNL() const | |||
std::optional<PublicKey> | |||
Ledger::validatorToDisable() const | |||
{ | |||
if (auto sle = readSLE(keylet::negativeUNL()); | |||
sle && sle->isFieldPresent(sfValidatorToDisable)) | |||
if (auto nUNLLedgerObj = read<NegUNLKeylet, NegUNLImpl<false>>(keylet::negativeUNL()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember the details, but the compiler was throwing an error without an explicit specialization of the read<>
function template. I'll investigate if I can remove the verbosity.
src/ripple/protocol/NegativeUNL.h
Outdated
#define RIPPLE_PROTOCOL_NEGATIVE_UNL_H_INCLUDED | ||
|
||
#include <ripple/protocol/LedgerEntryWrapper.h> | ||
//#include <ripple/protocol/STAccount.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i forgot to remove these comments, will do while addressing the PR comments. I hope that's ok
src/ripple/protocol/NegativeUNL.h
Outdated
} | ||
|
||
[[nodiscard]] bool | ||
isFieldPresent(SField const& field) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the NegativeUNL
and Amendments
ledger objects are singletons. Hence, there is possibility of re-writing some of these functions as static
functions.
But I'm not sure if that is a good design decision.
- Remove old comments - Update copyrights information to year 2023 - Include explicit type information instead of using auto keyword
…inside the codebase
Type of Change